﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfApp3
{
    /// <summary>
    /// Box.xaml 的交互逻辑
    /// </summary>
    public partial class Box : Window
    {
        public Box()
        {
            InitializeComponent();
            List <string> list = new List<string>();
            list.Add("1213");
            list.Add("123");
            list.Add("54654");
            this.List.ItemsSource = list;

            ////DataGrid绑定
            //List<Employee> employees = new List<Employee>();
            //employees.Add(new Employee()
            //{
            //    name = "123",
            //    age = "12",
            //    sex = "男",
            //    address="544653"
            //});
            //employees.Add(new Employee()
            //{
            //    //默认为哦哦复选框选中状态
            //    IsSelect = true,
            //    name = "2",
            //    age = "3",
            //    address = "544653"
            //});
            //employees.Add(new Employee()
            //{
            //    name = "4",
            //    age = "12",
            //    sex = "女",
            //    address = "544653"
            //});
            //this.view.ItemsSource = employees;
            //this.cbox.ItemsSource = new List<string> { "男", "女" };
        }

        private void List_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //点击那个把选中的放在textblock中
            text.Text=(sender as ListBox).SelectedItem.ToString();
        }
    }
}
